package com.blog.blog.service;

import com.blog.blog.dao.pojo.LoginTicket;
import com.blog.blog.dao.pojo.SysUser;
import com.blog.blog.vo.Result;
import com.blog.blog.vo.UserVo;
import org.springframework.security.core.GrantedAuthority;

import javax.servlet.http.HttpServletResponse;
import java.util.Collection;
import java.util.Map;

public interface SysUserService {

    SysUser findUserById(Long id);

    SysUser findUser(String account, String password);

    /**
     * 根据token查询用户信息
     * @return
     */
    Result getUserInfoByToken(String ticket);

    /**
     * 根据账户查询用户
     * @param account
     * @return
     */
    SysUser findUserByAccount(String account);

    /**
     * 保存账户
     * @param sysUser
     */
    void save(SysUser sysUser);

    UserVo findUserVoById(Long id);

    Collection<? extends GrantedAuthority> getAuthorities(Long userId);

    LoginTicket findLoginTicket(String ticket);

    Result login(String account, String password, int expiredSeconds, HttpServletResponse response);
}
